/*!
* @preserve Palmoto Bloks
* http://www.palmoto.com
* Copyright (c) 2013 Andrew Richardson
* MIT License http://opensource.org/licenses/mit-license.php
*/
(function(n, t)
{
    n[t] || (n[t] = {});
    var i = n[t];
    i.M = {
        _INIT: function()
        {
            "indexOf" in Array.prototype || (Array.prototype.indexOf = function(n)
            {
                for (var t = 0, i = this.length; t < i; t++)
                    if (t in this && this[t] === n)
                        return t;
                return -1
            })
        }, _: {
                cache: null, node: {
                        create: function(n, t)
                        {
                            var r = document.createElement(n),
                                i;
                            for (i in t)
                                r.setAttribute(i, t[i]);
                            return r
                        }, get: function(n, t, r, u)
                            {
                                var f = i.Qwery(n ? n : "*", t),
                                    o,
                                    s,
                                    e;
                                if (u && f)
                                {
                                    for (o = [], s = i.M._.node.get(u), e = 0; e < f.length; e++)
                                        s.contains(f[e]) || o.push(f[e]);
                                    f = o
                                }
                                return r ? f : f[0]
                            }, getByName: function(n, t, r, u)
                            {
                                var f = i.Qwery((t ? t : "*") + '[name="' + n + '"]', r);
                                return u ? f : f[0]
                            }, getAttributeByName: function(n, t, i)
                            {
                                var r = this.getByName(n, i);
                                return r ? r.getAttribute(t) : ""
                            }, getValueByName: function(n, t)
                            {
                                var i = this.getByName(n, t);
                                return t == "select" ? i.options[i.selectedIndex].value : i.value
                            }, hasClass: function(n, t)
                            {
                                return (" " + n.className + " ").indexOf(" " + t + " ") > -1
                            }, addClass: function(n, t)
                            {
                                this.hasClass(n, t) || (n.className += " " + t)
                            }, removeClass: function(n, t)
                            {
                                for (var i = n.className.split(" "); i.indexOf(t) !== -1; )
                                    delete i[i.indexOf(t)];
                                n.className = i.join(" ")
                            }
                    }, url: {params: {
                            get: function(n)
                            {
                                var t = {};
                                return n.replace(/\??([^?=&#]+)(=([^&#]*))?/g, function(n, r, u, f)
                                    {
                                        i.M._.object.isUndefined(f) || (t[r] = i.M._.string.convert(decodeURIComponent(f)))
                                    }), t
                            }, object: function(n)
                                {
                                    var i = [],
                                        t;
                                    for (t in n)
                                        this.collect(i, t, n[t]);
                                    return i.join("&")
                                }, pair: function(n, t)
                                {
                                    return i.M._.object.isSet(n) ? encodeURIComponent(n) + "=" + encodeURIComponent(t) : null
                                }, form: function(n)
                                {
                                    for (var u, e = [], f, r = i.M._.node.get("textarea,input,select", n, !0), t = 0; t < r.length; t++)
                                        if (f = r[t].type, f == "select-multiple")
                                            for (u = r[t].options.length - 1; u >= 0; u = u - 1)
                                                r[t].options[u].selected && this.collect(e, r[t].name, r[t].options[u].value);
                                        else
                                            (f != "radio" && f != "checkbox" || r[t].checked) && this.collect(e, r[t].name, r[t].value);
                                    return e.join("&")
                                }, collect: function(n, t, i)
                                {
                                    var r = this.pair(t, i);
                                    return r && n.push(r), n
                                }
                        }}, document: {
                        script: {
                            load: function(n, t)
                            {
                                var r = i.M._.node.create("script");
                                r.type = "text/javascript",
                                r.readyState ? t && (r.onreadystatechange = function()
                                {
                                    (r.readyState == "loaded" || r.readyState == "complete") && (r.onreadystatechange = null, t())
                                }) : t && (r.onload = function()
                                {
                                    t()
                                }),
                                r.src = n,
                                i.M._.node.get("head").appendChild(r)
                            }, source: function(n)
                                {
                                    for (var r = i.M._.node.get("script", null, !0), t = 0; t < r.length; t++)
                                        if (index = r[t].src.indexOf(n), index != -1)
                                            return r[t].src;
                                    return null
                                }
                        }, style: {append: function(n)
                                {
                                    var t = i.M._.node.create("style");
                                    t.type = "text/css",
                                    t.styleSheet ? t.styleSheet.cssText = n : t.appendChild(document.createTextNode(n)),
                                    i.M._.node.get("head").appendChild(t)
                                }}
                    }, event: {
                        add: function(n, t, i)
                        {
                            if (n.addEventListener)
                                return n.addEventListener(t, i, !0), !0;
                            if (n.attachEvent)
                            {
                                var r = t.indexOf("DOM") == 0 ? t : "on" + t;
                                return n.attachEvent(r, i)
                            }
                            return !1
                        }, target: function(n)
                            {
                                var t = n || window.event;
                                return t.target || t.srcElement
                            }, delegate: function(n, t)
                            {
                                var r = n != null ? this.target(n) : t,
                                    u = r.getAttribute("data-route");
                                return !i.M._.object.isSet(u) && i.M._.node.hasClass(r, "bubble") && r.parentNode != null ? this.delegate(null, r.parentNode) : r
                            }
                    }, xhr: {
                        open: function(n, t)
                        {
                            var r = new XMLHttpRequest;
                            if ("withCredentials" in r)
                                r.open(n, t, !0);
                            else if (typeof XDomainRequest != "undefined")
                            {
                                r = new XDomainRequest;
                                try
                                {
                                    r.open(n, t)
                                }
                                catch(u)
                                {
                                    i.C._.alert("Request not supported. Please use Google Chrome or Firefox."),
                                    r = null
                                }
                            }
                            else
                                r = null;
                            return r
                        }, send: function(n, t, i, r)
                            {
                                var u = this.open(n, t);
                                u && (r && (u.onload = function()
                                {
                                    r(u.responseText)
                                }), n == "post" && i != null ? (u.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"), u.send(i)) : u.send())
                            }, get: function(n, t)
                            {
                                this.send("get", n, null, t)
                            }, post: function(n, t, i)
                            {
                                this.send("post", n, t, i)
                            }
                    }, object: {
                        clobber: function(n, t)
                        {
                            var i,
                                r;
                            for (i in t)
                                (t.hasOwnProperty(i) || !n[i]) && (n[i] = t[i]);
                            return arguments.length > 2 ? (r = Array.prototype.slice.call(arguments), r.splice(1, 1), this.clobber.apply(this, r)) : n
                        }, isArray: function(n)
                            {
                                return !!(n && n.concat && n.unshift && !n.callee)
                            }, isFunction: function(n)
                            {
                                return !!(n && n.constructor && n.call && n.apply)
                            }, isString: function(n)
                            {
                                return !!(n === "" || n && n.charCodeAt && n.substr)
                            }, isUndefined: function(n)
                            {
                                return typeof n == "undefined"
                            }, isSet: function(n)
                            {
                                if (!this.isUndefined(n) && n !== null && n !== "")
                                    if (this.isArray(n))
                                    {
                                        if (n.length > 0)
                                            return !0
                                    }
                                    else
                                        return !0;
                                return !1
                            }, setByPath: function(n, t, r)
                            {
                                var u = t.split("/", 3),
                                    f = u.length;
                                try
                                {
                                    f == 1 && (n[u[0]] = r),
                                    f == 2 && (n[u[0]][u[1]] = r),
                                    f == 3 && (n[u[0]][u[1]][u[2]] = r)
                                }
                                catch(e)
                                {
                                    i.C._.log("Path parse error.@" + e.toString())
                                }
                                return n
                            }, getByPath: function(n, t)
                            {
                                var u = t.split("/", 3),
                                    f = u.length,
                                    r = undefined;
                                try
                                {
                                    f >= 1 && (r = n[u[0]]),
                                    f >= 2 && (r = r[u[1]]),
                                    f == 3 && (r = r[u[2]])
                                }
                                catch(e)
                                {
                                    i.C._.log("Object path error:" + e.toString())
                                }
                                return r
                            }, sort: function(n, t)
                            {
                                return function(i, r)
                                    {
                                        var u = i[n] < r[n] ? -1 : i[n] > r[n] ? 1 : 0;
                                        return u * t
                                    }
                            }
                    }, string: {
                        trim: function(n)
                        {
                            return i.M._.object.isString(n) ? n.replace(/^[\s]+|[\s]+$/g, "") : ""
                        }, clean: function(n)
                            {
                                return "s" + n.replace(/[_\.\/\:\?\=\&]/g, "u")
                            }, random: function(n)
                            {
                                return (n || "") + (Math.floor(Math.random() * 1001) + 1e3)
                            }, convert: function(n)
                            {
                                if (!i.M._.object.isSet(n))
                                    return n;
                                switch (n.toLowerCase())
                                {
                                    case"true":
                                    case"yes":
                                        return !0;
                                    case"false":
                                    case"no":
                                        return !1;
                                    default:
                                        return n
                                }
                            }
                    }, date: {utcTimestamp: function()
                        {
                            var n = new Date;
                            return n.getTime() + n.getTimezoneOffset() * 6e4
                        }}, google: {feed: {
                            key: function(n)
                            {
                                return {
                                        data: this.dataKey(n), form: this.formKey(n), title: null
                                    }
                            }, extractKey: function(n)
                                {
                                    var t = this.formKey(n);
                                    return (i.M._.object.isSet(t) || (t = this.dataKey(n)), i.M._.object.isSet(t)) ? t : null
                                }, type: function(n)
                                {
                                    return n ? n.match(/^([\w]{34})$/) ? 1 : n.match(/^([A-Za-z0-9]{44})\/?([A-Za-z0-9]{3,4})?\/?$/) ? 2 : 0 : 0
                                }, dataKey: function(n)
                                {
                                    var r = n,
                                        t = n.match(/^https?:\/\/spreadsheets.google.com\/feeds\/list\/(.*)\/public\/values.*/),
                                        u;
                                    return t == null && (t = n.match(/\/worksheets\/(.*)\/public\/basic\/(o.*)$/)), t != null ? (t.length == 2 && (r = t[1]), t.length == 3 && (r = t[1] + "/" + t[2])) : (t = n.match(/^https?:\/\/docs.google.com\/.*$/), t != null && (u = i.M._.url.params.get(n), r = u.key)), this.type(r) == 2 ? r : ""
                                }, formKey: function(n)
                                {
                                    var t = n,
                                        u = n.match(/^https?:\/\/docs.google.com\/.*$/),
                                        r;
                                    return u != null && (r = i.M._.url.params.get(n), t = r.formkey), this.type(t) == 1 ? t : ""
                                }
                        }}
            }, __: {
                shell: {id: "blok-shell"}, options: {
                        data: {
                            $g: "Data", sort: {$t: "Sort"}
                        }, blok: {
                                $g: "Blok", reload: {$t: "Refresh"}, drive: {$t: "Google Drive"}, breakout: {$t: "Breakout"}, remove: {$t: "Remove"}
                            }, bloks: {
                                $g: "Bloks", breakout: {$t: "Breakout"}
                            }, nectar: {
                                modes: {
                                    replace: {
                                        $t: "Replace", $v: function()
                                            {
                                                return null
                                            }
                                    }, append: {
                                            $t: "Append", $v: function()
                                                {
                                                    return null
                                                }
                                        }, override: {
                                            $t: "Override", $v: function()
                                                {
                                                    return null
                                                }
                                        }
                                }, types: {
                                        content: {
                                            $g: "Content", text: {
                                                    $t: "Text", $v: function()
                                                        {
                                                            return i.V._.selection.text()
                                                        }
                                                }, html: {
                                                    $t: "HTML", $v: function()
                                                        {
                                                            return i.V._.selection.html(!0)
                                                        }
                                                }
                                        }, link: {
                                                $g: "Link", a_href: {
                                                        $t: "Url (href)", $v: function()
                                                            {
                                                                return i.V._.selection.attribute("a", "href", !0)
                                                            }
                                                    }, a_title: {
                                                        $t: "Title", $v: function()
                                                            {
                                                                return i.V._.selection.attribute("a", "title", !0)
                                                            }
                                                    }
                                            }, image: {
                                                $g: "Image", img_src: {
                                                        $t: "Url (src)", $v: function()
                                                            {
                                                                return i.V._.selection.attribute("img", "src")
                                                            }
                                                    }, img_alt: {
                                                        $t: "Title (alt)", $v: function()
                                                            {
                                                                return i.V._.selection.attribute("img", "alt")
                                                            }
                                                    }, img_width: {
                                                        $t: "Width", $v: function()
                                                            {
                                                                return i.V._.selection.attribute("img", "width")
                                                            }
                                                    }, img_height: {
                                                        $t: "Height", $v: function()
                                                            {
                                                                return i.V._.selection.attribute("img", "height")
                                                            }
                                                    }
                                            }, document: {
                                                $g: "Document", href: {
                                                        $t: "Href", $v: window.location.href
                                                    }, author: {
                                                        $t: "Author", $v: function()
                                                            {
                                                                return i.M._.node.getAttributeByName("author", "content", "meta")
                                                            }
                                                    }, title: {
                                                        $t: "Title", $v: document.title
                                                    }, description: {
                                                        $t: "Description", $v: function()
                                                            {
                                                                return i.M._.node.getAttributeByName("description", "content", "meta")
                                                            }
                                                    }, keywords: {
                                                        $t: "Keywords", $v: function()
                                                            {
                                                                return i.M._.node.getAttributeByName("keywords", "content", "meta")
                                                            }
                                                    }, modified: {
                                                        $t: "Modified", $v: document.lastModified
                                                    }
                                            }, number: {
                                                $g: "Number", decimal: {
                                                        $t: "Decimal", $v: function()
                                                            {
                                                                var n = i.V._.selection.text();
                                                                return Number(n ? n.replace(/[^\d.]/g, "") : 0)
                                                            }
                                                    }, integer: {
                                                        $t: "Integer", $v: function()
                                                            {
                                                                var n = i.V._.selection.text();
                                                                return parseInt(n ? n.replace(/[^\d.]/g, "") : 0)
                                                            }
                                                    }
                                            }, date: {
                                                $g: "Date", local: {
                                                        $t: "Local (text)", $v: function()
                                                            {
                                                                return new Date
                                                            }
                                                    }, local_milliseconds: {
                                                        $t: "Local (ms)", $v: function()
                                                            {
                                                                return +new Date
                                                            }
                                                    }, local_seconds: {
                                                        $t: "Local (s)", $v: function()
                                                            {
                                                                return Math.round(+new Date / 1e3)
                                                            }
                                                    }, utc: {
                                                        $t: "UTC (text)", $v: function()
                                                            {
                                                                return (new Date).toUTCString()
                                                            }
                                                    }, utc_milliseconds: {
                                                        $t: "UTC (ms)", $v: function()
                                                            {
                                                                var n = new Date;
                                                                return n.getTime() + n.getTimezoneOffset() * 6e4
                                                            }
                                                    }, utc_seconds: {
                                                        $t: "UTC (s)", $v: function()
                                                            {
                                                                var n = new Date;
                                                                return Math.round((n.getTime() + n.getTimezoneOffset() * 6e4) / 1e3)
                                                            }
                                                    }
                                            }
                                    }
                            }, share: {
                                $g: "Share", twitter: {$t: "Twitter"}, facebook: {$t: "Facebook"}, google: {$t: "Google+"}, addthis: {$t: "AddThis"}, email: {$t: "Email"}
                            }, support: {
                                $g: "Help", documentation: {$t: "Documentation"}, feedback: {$t: "Feedback"}, registration: {$t: "Register"}
                            }
                    }
            }, Cache_INIT: function()
            {
                i.M._.cache = new i.M.Cache
            }, Cache: function()
            {
                i.M._.object.clobber(this, {
                    prefix: "", onRegister: function(n)
                        {
                            n && n.prefix && (this.prefix = n.prefix)
                        }, storage: null, _storage: {
                            _cache: {}, setItem: function(n, t)
                                {
                                    this._cache[n] = t
                                }, removeItem: function(n)
                                {
                                    this._cache[n] = null
                                }, getItem: function(n)
                                {
                                    return this._cache[n] ? this._cache[n] : null
                                }
                        }, get: function(n)
                        {
                            try
                            {
                                return JSON.parse(this.storage.getItem(this.prefix + i.M._.string.clean(n)))
                            }
                            catch(t)
                            {
                                return i.C._.log("Cache Error @" + t), null
                            }
                        }, set: function(n, t)
                        {
                            try
                            {
                                return this.storage.setItem(this.prefix + i.M._.string.clean(n), JSON.stringify(t)), !0
                            }
                            catch(r)
                            {
                                return i.C._.log("Cache Error @" + r), !1
                            }
                        }, del: function(n)
                        {
                            try
                            {
                                this.storage.removeItem(this.prefix + i.M._.string.clean(n))
                            }
                            catch(t)
                            {
                                i.C._.log("Cache Error @" + t)
                            }
                        }, _init: function()
                        {
                            this.storage = this._test() ? window.localStorage : this._storage
                        }, _test: function()
                        {
                            if (document.location.host.indexOf("palmoto.com") == -1)
                                return !1;
                            try
                            {
                                if (window.localStorage && window.localStorage.setItem("cache", "ok") == undefined)
                                    if (/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent))
                                    {
                                        var n = RegExp.$1;
                                        if (n >= 9)
                                            return !0;
                                        if (window.location.protocol == "file:")
                                            return !1
                                    }
                                    else
                                        return !0;
                                else
                                    return !1;
                                return window.localStorage ? !0 : !1
                            }
                            catch(t)
                            {
                                return !1
                            }
                        }
                }),
                this.storage = this._test() ? window.localStorage : this._storage
            }, Object_INIT: function()
            {
                i.M._.object.clobber(i.M.Object.prototype, {
                    onRegister: function(n)
                    {
                        n && n.data && (this.data = n.data),
                        this.data || (this.data = {})
                    }, get: function(n)
                        {
                            if (!n)
                                return this.data;
                            var t = i.M._.object.getByPath(this.data, n);
                            return i.M._.object.isSet(t) ? t : null
                        }, set: function(n, t, r)
                        {
                            return n ? (this.data || (this.data = {}), i.M._.object.setByPath(this.data, n, t)) : this.data = t, i.M._.object.isUndefined(r) || r || this.notify("change"), !0
                        }, sort: function(n)
                        {
                            var r = n.split("/"),
                                u = r.pop(),
                                t = this.get(r.join("/"));
                            if (i.M._.object.isSet(t) && i.M._.object.isArray(t))
                                return this._sort.field == u ? this._sort.order = this._sort.order < 0 ? 1 : -1 : (this._sort.order = 1, this._sort.field = u), t.sort(i.M._.object.sort(this._sort.field, this._sort.order)), this.notify("change"), this._sort.order
                        }
                })
            }, Object: function()
            {
                i.M._.object.clobber(this, {
                    _sort: {
                        field: "", order: 1
                    }, data: null
                })
            }, Remote_INIT: function()
            {
                i.M._.object.clobber(i.M.Remote.prototype, {
                    onRegister: function(n)
                    {
                        if (n)
                        {
                            if (n.endpoint && (this.endpoint = n.endpoint), i.M._.object.isUndefined(n.script) || (this.script = n.script), n.parsers)
                                for (var t in n.parsers)
                                    this.parsers[t] = n.parsers[t];
                            this.cache = n.cache ? n.cache : i.M._.cache
                        }
                    }, fetchCache: function()
                        {
                            var n = this.cache.get(this.endpoint);
                            return n != null ? (this.set(null, n, !1), !0) : !1
                        }, fetch: function(n)
                        {
                            if (this.notify("busy"), i.M._.object.isUndefined(n) && (n = !0), !n || !this.cache || !this.fetchCache())
                            {
                                var t = this;
                                return this.timeout = this.callback = String("c" + Math.random()).replace(".", ""), i.C._.timers[this.timeout] = setTimeout(function()
                                    {
                                        window[t.callback] = null,
                                        t.notify("error"),
                                        i.C._.timers[t.timeout] = null
                                    }, 5e3), this.script ? (window[this.callback] = function(n)
                                        {
                                            clearTimeout(i.C._.timers[t.timeout]);
                                            return t.onResponse(n)
                                        }, i.M._.document.script.load(this.endpoint + (this.endpoint.indexOf("?") != -1 ? "&" : "?") + "callback=" + this.callback)) : i.M._.xhr.get(this.endpoint, function(n)
                                        {
                                            clearTimeout(i.C._.timers[t.timeout]);
                                            return t.onResponse(n)
                                        }), this
                            }
                        }, onResponse: function(n)
                        {
                            return n == null ? !1 : this.set(null, this.parse(n), !1) ? (this.cache && this.cache.set(this.endpoint, this.get()), this.callback && (window[this.callback] = null), !0) : !1
                        }, refresh: function()
                        {
                            this.fetch(!1)
                        }, getParser: function(n)
                        {
                            var t,
                                i,
                                r;
                            for (i in this.parsers)
                                if (i.indexOf("__") != 0)
                                {
                                    t = !0;
                                    for (r in this.parsers[i])
                                        if (r.indexOf("__") != 0 && !n.hasOwnProperty(r))
                                        {
                                            t = !1;
                                            continue
                                        }
                                    if (t)
                                        break
                                }
                            return t ? this.parsers[i] : null
                        }
                })
            }, Remote: function()
            {
                i.M._.object.clobber(this, new i.M.Object, {
                    callback: null, timeout: null, endpoint: "", data: {}, cache: null
                })
            }, Feed_INIT: function()
            {
                i.M._.object.clobber(i.M.Feed.prototype, {
                    script: !0, configure: function()
                        {
                            this.listen(this.name + "/refresh", this.refresh)
                        }, parse: function(n)
                        {
                            var r = {},
                                u,
                                f,
                                t,
                                e;
                            if (!i.M._.object.isUndefined(n.feed))
                            {
                                if (r.title = n.feed.title.$t, r.key = this.extractKey(), r.entry = [], r.refreshed = i.M._.date.utcTimestamp(), !i.M._.object.isSet(n.feed.entry))
                                    return r;
                                if (t = {}, this.endpoint.indexOf("/worksheets/") != -1)
                                {
                                    for (f = {
                                        __type: "worksheets", title: function(n, t)
                                            {
                                                return t
                                            }, id: function(n, t)
                                            {
                                                return t
                                            }
                                    }, r.type = f.__type, u = 0; u < n.feed.entry.length; u++)
                                        (t = {}, i.M._.object.isSet(n.feed.entry[u])) && (t.title = f.title(this, n.feed.entry[u].title.$t), t.id = f.id(this, n.feed.entry[u].id.$t), r.entry.push(t));
                                    return r
                                }
                                for (t = this.extractEntry(n.feed.entry[0]), f = this.getParser(t), r.type = f ? f.__type : "generic", u = 0; u < n.feed.entry.length; u++)
                                    if (t = this.extractEntry(n.feed.entry[u]), t)
                                    {
                                        if (f)
                                            for (e in t)
                                                f[e] && (t[e] = f[e](this, t[e]));
                                        r.entry.push(t)
                                    }
                            }
                            return r
                        }, extractEntry: function(n)
                        {
                            var r = {},
                                u,
                                o = !1,
                                e,
                                f,
                                t;
                            for (e in n)
                                f = i.M._.string.trim(n[e].$t),
                                (t = e.match(/gsx\$(.*)/)) && (u = t[1].toLowerCase().replace(/^(.*)_[\d]$/, "$1"), i.M._.object.isSet(r[u]) ? i.M._.object.isArray(r[u]) ? r[u].push(f) : r[u] = [r[u], f] : (u == "timestamp" && (t = f.match(/^([0-9]{1,2})\/([0-9]{1,2})\/([0-9]{4}) ([0-9]{2})\:([0-9]{2})\:([0-9]{2})$/), r._timestamp = t && t.length == 7 ? new Date(t[3], t[1], t[2], t[4], t[5], t[6]).getTime() : 0), r[u] = f), o = !0);
                            return o ? r : null
                        }, extractKey: function(n)
                        {
                            var t = n || this.endpoint;
                            return i.M._.google.feed.dataKey(t)
                        }, getDataUrl: function(n)
                        {
                            var t = this.extractKey(n),
                                r = null;
                            return i.M._.object.isSet(t) ? (t.indexOf("/") == -1 ? r = "https://spreadsheets.google.com/feeds/worksheets/" + t + "/public/basic" : (t = t.split("/"), r = "https://spreadsheets.google.com/feeds/list/" + t[0] + "/" + t[1] + "/public/values"), r + "?alt=json-in-script") : r
                        }, getViewUrl: function()
                        {
                            return "https://docs.google.com/spreadsheet/ccc?key=" + this.extractKey().split("/")[0]
                        }
                })
            }, Feed: function()
            {
                i.M._.object.clobber(this, new i.M.Remote, {parsers: {}})
            }, Form_INIT: function()
            {
                i.M._.object.clobber(i.M.Form.prototype, {
                    script: !1, parse: function(n)
                        {
                            var i = n.match(/^[\s\S]*(<form[\s\S]*<\/form>)[\s\S]*$/),
                                t;
                            return !i || !i.length > 1 ? null : (t = {}, t.form = i[1].replace(/<br>/g, ""), t.title = n.match(/<h1 class="ss-form-title">(.*)<\/h1>/)[1], t.key = this.extractKey(), t)
                        }, extractKey: function(n)
                        {
                            var t = n || this.endpoint;
                            return i.M._.google.feed.formKey(t)
                        }, getDataUrl: function(n)
                        {
                            var t = this.extractKey(n);
                            return i.M._.object.isSet(t) ? "https://docs.google.com/spreadsheet/viewform?formkey=" + t : null
                        }, getViewUrl: function()
                        {
                            return "https://docs.google.com/spreadsheet/viewform?formkey=" + this.extractKey()
                        }
                })
            }, Form: function()
            {
                i.M._.object.clobber(this, new i.M.Remote)
            }
    },
    i.V = {
        _: {
            html: {
                get: function(n, t)
                {
                    if (!n)
                        return null;
                    if (t)
                    {
                        var i = document.createElement("div");
                        return i.appendChild(n.cloneNode(!0)), i.innerHTML
                    }
                    return n.innerHTML
                }, set: function(n, t)
                    {
                        if (!n)
                            return null;
                        n.innerHTML = t
                    }, template: function(n, t)
                    {
                        if (!t)
                            return n;
                        var r = "var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('" + n.replace(/\\/g, "\\\\").replace(/'/g, "\\'").replace(/<%=([\s\S]+?)%>/g, function(n, t)
                            {
                                return "'," + t.replace(/\\'/g, "'") + ",'"
                            }).replace(/<%([\s\S]+?)%>/g || null, function(n, t)
                            {
                                return "');" + t.replace(/\\'/g, "'").replace(/[\r\n\t]/g, " ") + "__p.push('"
                            }).replace(/\r/g, "\\r").replace(/\n/g, "\\n").replace(/\t/g, "\\t") + "');}return __p.join('');",
                            i = new Function("obj", r);
                        return t ? i(t) : i
                    }, options: function(n, t, i)
                    {
                        function f(n, t)
                        {
                            var i = document.createElement("OPTION");
                            return i.innerHTML = t, i.value = n, i
                        }
                        function o(n)
                        {
                            var t = document.createElement("optgroup");
                            return t.label = n, t
                        }
                        var e,
                            r,
                            u;
                        i && n.options.add(f(i, i));
                        for (r in t)
                            if (t[r].$g)
                            {
                                e = o(t[r].$g);
                                for (u in t[r])
                                    u.indexOf("$") != 0 && e.appendChild(f(r + "/" + u, t[r][u].$t));
                                n.appendChild(e)
                            }
                            else
                                n.appendChild(f(r, t[r].$t))
                    }
            }, text: {
                    get: function(n)
                    {
                        if (!n)
                            return null;
                        var t = n.tagName.toLowerCase();
                        return t === "input" || t === "select" ? n.value : "textContent" in n ? n.textContent : n.innerText
                    }, set: function(n, t, i)
                        {
                            if (!n)
                                return null;
                            var r = n.tagName.toLowerCase(),
                                u = r === "input" || r === "select";
                            i == "append" ? this._append(n, t, u) : this._replace(n, t, u)
                        }, _replace: function(n, t, i)
                        {
                            i ? n.value = t : "textContent" in n ? n.textContent = t : n.innerText = t
                        }, _append: function(n, t, i)
                        {
                            var r = this.get(n);
                            this._replace(n, r + (r == "" ? "" : " ") + t, i)
                        }
                }, style: {
                    get: function(n, t)
                    {
                        var i = null;
                        return n.currentStyle ? i = n.currentStyle[t] : window.getComputedStyle && (i = document.defaultView.getComputedStyle(n, null).getPropertyValue(t)), i
                    }, display: {toggle: function(n)
                            {
                                var t = n.offsetWidth == 0;
                                return n.style.display = t ? "block" : "none", t
                            }}
                }, selection: {
                    _clone: document.createElement("div"), get: function()
                        {
                            if (window.getSelection)
                            {
                                var n = window.getSelection();
                                return n.rangeCount ? n : null
                            }
                            return null
                        }, nodes: function(n, t)
                        {
                            return this.html(t, n)
                        }, html: function(n, t)
                        {
                            var u = this.get(),
                                f,
                                e,
                                r;
                            if (!u)
                                return null;
                            for (e = u.getRangeAt(0), r = e.commonAncestorContainer, n && u.toString() == r.textContent ? (r.nodeType != 1 && (r = r.parentNode), f = r.cloneNode(!0)) : f = e.cloneContents(); this._clone.hasChildNodes(); )
                                this._clone.removeChild(this._clone.lastChild);
                            return this._clone, this._clone.appendChild(f), t ? i.M._.node.get(t, this._clone, !0) : this._clone.innerHTML
                        }, text: function()
                        {
                            var n = this.get();
                            return n ? n.toString() : null
                        }, attribute: function(n, t, i)
                        {
                            var u = this.nodes(n, i),
                                f = [],
                                r;
                            if (!u)
                                return f;
                            for (r = 0; r < u.length; r++)
                                u[r][t] ? f.push(u[r][t]) : u[r].getAttribute(t) && f.push(u[r].getAttribute(t));
                            return f
                        }
                }
        }, Mediator_INIT: function()
            {
                i.M._.object.clobber(i.V.Mediator.prototype, {
                    onRegister: function(n)
                    {
                        n.view && (n.view.id && (this.view.id = n.view.id), n.view.root && (this.view.root = n.view.root), n.view.style && (this.view.style = n.view.style));
                        for (var t in this.templates)
                            this.addTemplate(t, this.templates[t]);
                        this.getTemplate("_root") != null && (this.view.cache("_root", "#" + this.view.id), this.setNodeHtml("_root", this.getTemplate("_root"), {
                            name: this.name, id: this.view.id, style: this.view.style
                        }), this.view.root && i.M._.node.addClass(this.view.root, this.view.style)),
                        this.configure(n.config || {})
                    }, addHandler: function(n, t)
                        {
                            this.listen(n, this.handler, t)
                        }, show: function()
                        {
                            this.view.root.style.display = "block"
                        }, hide: function()
                        {
                            this.view.root.style.display = "none"
                        }, getNodeText: function(n)
                        {
                            return i.V._.text.get(this.view.nodes[n] || i.M._.node.get("#" + n))
                        }, setNodeText: function(n, t, r)
                        {
                            var u = this.view.nodes[n] || i.M._.node.get("#" + n);
                            return i.V._.text.set(u, t, r), u
                        }, setNodeHtml: function(n, t, r)
                        {
                            var u = this.view.nodes[n] || i.M._.node.get("#" + n);
                            return i.V._.html.set(u, i.V._.html.template(t, r)), u
                        }, addTemplate: function(n, t)
                        {
                            this._templates[n] = t
                        }, getTemplate: function(n)
                        {
                            return this._templates[n]
                        }, _templates: {}
                })
            }, Mediator: function()
            {
                i.M._.object.clobber(this, {
                    view: {
                        id: null, root: null, nodes: {}, style: "", cache: function(n, t, r, u)
                            {
                                return this.nodes[n] = r ? i.M._.node.getByName(t, r, u ? u : this.root) : i.M._.node.get(t, u ? u : this.root), n == "_root" && (this.root = this.nodes[n]), this.nodes[n]
                            }
                    }, configure: function(){}, handler: function(){}, templates: {}
                })
            }, ShellMediator: function()
            {
                i.M._.object.clobber(this, new i.V.Mediator, {configure: function(n)
                    {
                        var o,
                            h,
                            f,
                            u,
                            e,
                            s,
                            c,
                            l,
                            a;
                        this.view.id = n.id,
                        this.view.style = "scheme-charcoal";
                        var v = "#" + this.view.id,
                            t = "#palmoto-bloks",
                            r = "";
                        for (r += t + ' .blok-shell{ font-family:"Trebuchet MS", Helvetica, sans-serif; text-align:left; font-size: 13px;  }', r += t + " .blok-shell-header{}", r += t + " *{float:none; width:auto; height:auto; margin:0px; padding:0px; border:none; background-color:transparent; text-align:inherit; }", r += t + " p{margin: 0.5em 0px;}", r += t + " ul," + t + " ol {margin:0 1.5em 1.5em 0;padding-left:1.5em;}", r += t + " ul {list-style-type:disc;}", r += t + " ol {list-style-type:decimal;}", r += t + " .blok-shell-stack{ margin:8px auto; min-width:150px; max-width:600px; display:block; clear:both;}", r += t + " .blok-shell-stack input, ", r += t + " .blok-shell-stack select{ margin:2px; padding:2px;border:1px solid #808080; font-size: 13px; line-height: 1.231; color:#212121;}", r += t + " h1," + t + " h2," + t + " h3," + t + " h4," + t + " h5," + t + " h6 {display:block;font-variant:small-caps;margin:3px 0px;border-bottom:1px dotted #333;clear:both;}", r += t + " h1 {font-size:1.5em;/*24px */}", r += t + " h2{font-size:1.375em;/*22px */}", r += t + " h3{font-size: 1.250em;/*20px */}", r += t + " h4{font-size: 1.125em;/*18px */}", r += t + " h5{font-size: 1em;/*16px */}", n.params.embed || (r += t + " .blok-shell{ font-size: small; background-color:#212121; position:fixed; top:0px; right:0px; margin:10px; z-index:2147483638;  border-radius: 10px 0px 0px 10px; padding:10px 0px; }", r += t + " .blok-shell-stack{ width:300px; max-height:400px; overflow-y:scroll; resize: both;}", r += t + " .blok-shell-stack input, ", r += t + " .blok-shell-stack select{ font-size:x-small; }"), r += "#blok-alert {position:absolute;display:none; opacity: 0.5; background:#eaeaea; top:0px;left:0px; width:100%; height:100%; z-index:2147483639; filter:alpha(opacity=50);}", r += t + " .blok,", r += t + " .blok{margin:.5em;padding-bottom:.2em;}", r += t + " .blok-title{display:block;padding:.4em;margin-bottom:.2em;cursor:pointer;}", r += t + " .blok-sub-title{padding-right:10px;font-size:x-small;overflow:hidden; text-overflow:ellipsis; white-space:nowrap; resize: none;}", r += t + " .blok-body{display:none;}", o = "-webkit-border-radius: 6px; -moz-border-radius: 6px; border-radius: 6px;", r += t + " .blok-content{word-wrap:break-word;  clear:both; resize:none; margin:.3em; padding:.2em; clear:both; background:#FFF; border:1px solid #FFF;color:#212121;" + o + "}", r += t + " .blok-content-tags{padding:.4em;}", r += t + " .blok-content-tag{display:block;font-variant:small-caps;margin: 3px 0px;border-bottom:1px dotted #333}", r += t + " .blok-content-table-tab{display:block;text-align:right;font-variant:small-caps;}", r += t + " .blok-content table {width:100%;}", r += t + " .blok-content table td {margin:1px;padding:2px;border:1px dotted #333}", r += t + " .blok-hidden{display:none;}", r += t + " .blok-center{text-align:center;}", r += t + " .blok-tab, ", r += t + " .blok-icon{cursor:pointer;padding:2px;font-size: small;}", r += t + " .blok-icon{float:right;}", r += t + " .blok-inline-links{line-height:1.8em;}", r += t + " .blok-inline-links > a,", r += t + " .blok-inline-links > span {cursor:pointer; text-decoration:none; padding:0px 2px 1px 2px; font-variant:small-caps;}", r += t + " .blok-scratchpad{font-size:small;min-height:1.5em;}", r += t + " .blok-input-width{width:85%}", r += t + " .blok-key{cursor:pointer;font-size:x-small;font-style:italic;width:100%;margin:2px 0px;}", h = t + " .scheme-%n," + t + " .scheme-%n .blok-inline-links > a," + t + " .scheme-%n .blok-inline-links > span {background:%b;border:1px solid %b;color:%c;" + o + "}", f = [{
                                    n: "lime", b: "#5FB90F", c: "#FFF"
                                }, {
                                    n: "aqua", b: "#0097AA", c: "#FFF"
                                }, {
                                    n: "white", b: "#FFF", c: "#212121"
                                }, {
                                    n: "charcoal", b: "#383838", c: "#FFF"
                                }, {
                                    n: "coral", b: "#DC562E", c: "#FFF"
                                }, {
                                    n: "crimson", b: "#AE193F", c: "#FFF"
                                }, {
                                    n: "slate", b: "#5D3AB7", c: "#FFF"
                                }, {
                                    n: "violet", b: "#A200A9", c: "#FFF"
                                }], u = 0; u < f.length; u++)
                            r += h.replace(/%n/g, f[u].n).replace(/%b/g, f[u].b).replace(/%c/g, f[u].c);
                        r += t + " .blok-disabled{background:#EAEAEA;border:1px solid #EAEAEA;color:#666666;text-decoration:line-through;}",
                        r += t + " .blok-form-error{background:#212121;border:1px;color:#FFF;margin:1px 0px;padding:1px;" + o + "};",
                        r += "#blok-log {color:#fff;}",
                        r += t + " .ss-q-title, ",
                        r += t + " .ss-q-help{display:block;}",
                        r += t + " .ss-q-help {font-size:x-small;}",
                        r += t + " .ss-choice-item {list-style-type:none;}",
                        r += t + " .errorheader{display:none;}",
                        i.M._.document.style.append(r),
                        e = i.M._.node.get(t),
                        s = e ? "" : '<div id="' + t.substr(1) + '">',
                        s += '<div id="' + this.view.id + '"><div class="blok-shell"><div class="blok-shell-header">&nbsp;&nbsp;<span id="' + this.view.id + '-tab" class="blok-tab ' + this.view.style + '">&#9650;<\/span> <span class="blok-tab ' + this.view.style + '">&nbsp;Bloks&nbsp;<\/span>&nbsp;<\/div><div class="blok-shell-stack"><\/div><div id="blok-log"><\/div><\/div><\/div>',
                        s += e ? "" : "<\/div>",
                        c = n.params.container ? i.M._.node.get("#" + n.params.container) : document.body,
                        c.insertAdjacentHTML("afterbegin", s),
                        e = i.M._.node.get(t),
                        e.style.display = "block",
                        this.view.root = i.M._.node.get("#" + this.view.id),
                        this.view.nodes._tab = i.M._.node.get("#" + this.view.id + "-tab", this.view.root),
                        l = this.view.nodes._stack = i.M._.node.get(".blok-shell-stack", this.view.root),
                        a = this.view.nodes._statics = i.M._.node.get("#blok-static-stack"),
                        this.view.nodes._tab.onclick = function()
                        {
                            var n = i.V._.style.display.toggle(l);
                            this.innerHTML = n ? "&#9650;" : "&#9660;",
                            i.V._.style.display.toggle(a)
                        }
                    }})
            }, StackMediator: function()
            {
                i.M._.object.clobber(this, new i.V.Mediator, {
                    configure: function()
                    {
                        var n = this;
                        i.M._.event.add(this.view.root, "click", function(t)
                        {
                            var r = i.M._.event.delegate(t),
                                u = r.getAttribute("data-route");
                            i.M._.object.isSet(u) && (n.notify(u, t, r), t.preventDefault, t.stopPropagation)
                        })
                    }, showBlok: function(n, t, r)
                        {
                            var u = i.M._.node.get("#" + n, this.view.root),
                                f;
                            if (u)
                            {
                                u.style.display = "block";
                                return
                            }
                            f = t || this.view.root,
                            f.insertAdjacentHTML(r || "afterBegin", i.V._.html.template(this.getTemplate("_blok"), {id: n}))
                        }, hideBlok: function(n)
                        {
                            var t = i.M._.node.get("#" + n, this.view.root);
                            t && (t.style.display = "none")
                        }, templates: {
                            _root: "", _blok: '<div id="<%= id %>" class="blok"><\/div>'
                        }
                })
            }, BlokMediator_INIT: function()
            {
                i.M._.object.clobber(i.V.Mediator.prototype, {
                    busy: function()
                    {
                        this.setNodeHtml("_content", this.getTemplate("_busy"), {style: this.view.style})
                    }, error: function()
                        {
                            this.setNodeHtml("_content", this.getTemplate("_error"), {style: this.view.style})
                        }, ready: function(){}, toggleBody: function(n)
                        {
                            if (n && this.view.nodes._body.offsetWidth != 0)
                                return !0;
                            var t = i.V._.style.display.toggle(this.view.nodes._body);
                            return i.M._.node.get(".blok-toggle", this.view.root).innerHTML = t ? "&#9650;" : "&#9660;", t
                        }, setTitle: function(n, t, i)
                        {
                            return this.setNodeHtml("_title", this.getTemplate("_title"), {
                                    name: this.name, title: n, subtitle: t, action: i, style: this.view.style
                                }), this.view.nodes._title
                        }, setContent: function(n, t)
                        {
                            return this.setNodeHtml("_content", n, t), this.view.nodes._content
                        }
                })
            }, BlokMediator: function()
            {
                i.M._.object.clobber(this, new i.V.Mediator, {
                    configure: function(n)
                    {
                        var u = "#" + this.view.id,
                            t,
                            r;
                        (this.view.cache("_title", ".blok-title"), this.view.cache("_body", ".blok-body"), this.view.cache("_content", u + "-content"), t = i.M._.node.get("#" + n.key), t) && (i.M._.object.isSet(t.getAttribute("data-style")) && (i.M._.node.removeClass(this.view.root, this.view.style), this.view.style = t.getAttribute("data-style"), i.M._.node.addClass(this.view.root, this.view.style)), this.setNodeHtml("_title", this.getTemplate("_title"), {
                            name: this.name, title: t.getAttribute("data-title") || " ", subtitle: t.getAttribute("data-subtitle") || " ", action: "toggle", style: this.view.style
                        }), r = i.V._.html.get(t), this.setContent(r), i.M._.string.convert(t.getAttribute("data-open")) == !0 && this.toggleBody(!0), t.parentNode.removeChild(t))
                    }, _templates: {
                            _root: '<div class="blok-title"><\/div><div class="blok-body">' + '<div id="<%= id %>-content" class="blok-content">' + "<\/div><\/div>", _title: '<div data-route="<%= name %>/<%= action %>"><span class="blok-icon <%= style %> bubble blok-toggle">&#9660;<\/span><%= title %><% if(subtitle){ %><div class="blok-sub-title bubble"><%= subtitle %><\/div><% } else { %><br><br><% } %><\/div>', _busy: '<span class="<%= style %>">&nbsp;...&nbsp;<\/span>', _error: '<span class="<%= style %>">&nbsp;!&nbsp;<\/span>', _input: '<div id="<%= id %>"><input name="<%= id %>" type="text" class="blok-input-width" value="<%= value %>" /><% if(icon){ %><span class="blok-icon <%= icon.style %>" data-key="<%= id %>" data-route="<%= icon.route %>" title="<%= icon.title %>"><%= icon.label %><\/span><% } %><\/div>'
                        }
                })
            }, BeeMediator: function()
            {
                i.M._.object.clobber(this, new i.V.BlokMediator, {
                    configure: function(n)
                    {
                        this.view.cache("_title", ".blok-title"),
                        this.view.cache("_body", ".blok-body"),
                        this.view.cache("_content", "#" + this.view.id + "-content"),
                        this.view.cache("_scratchpad", ".blok-scratchpad"),
                        this.view.cache("_matches", ".blok-matches"),
                        this.view.cache("_type", "blok-option-type", "select"),
                        this.view.cache("_mode", "blok-option-mode", "select"),
                        this.view.cache("_options", this.view.id + "-options", "select"),
                        i.V._.html.options(this.view.nodes._type, n.types),
                        i.V._.html.options(this.view.nodes._mode, n.modes),
                        i.V._.html.options(this.view.nodes._options, n.options)
                    }, setForm: function(n)
                        {
                            for (var f = i.M._.string.random("entry_") + "_", e = this.setContent(n.replace(/for="entry_/g, 'for="' + f).replace(/id="entry_/g, 'id="' + f).replace(/errorbox-bad/g, "blok-content-error")), t, o, s, c, l = i.M._.node.get("input", e, !0), r, h, a, v, u = 0; u < l.length; u++)
                                t = l[u],
                                t && (t.type == "text" || t.nodeName == "TEXTAREA") && (c = t.previousElementSibling, r = i.V._.text.get(c), s = "", r && (h = r.match(/.*\[bee\/([[A-Za-z\/]*)\].*/), h != null && (s = h[1], r = r.replace("[bee/" + h[1] + "]", ""), i.V._.text.set(c, r))), f = l[u].getAttribute("id"), o = i.M._.node.create("input", {
                                        type: "button", value: ">", "data-target": f, "data-type": s, "data-route": this.name + "/collect", "class": "blok-exclude", title: "Collect " + s
                                    }), t.parentNode.insertBefore(o, t.previousSibling));
                            return a = i.M._.node.get(".errorheader", e), a && i.C._.alert(a.innerHTML.replace(/(<([^>]+)>)/ig, "")), v = i.M._.node.getByName("submit", "input", e), o = i.M._.node.create("input", {
                                        type: "reset", value: "Clear", "class": "blok-exclude"
                                    }), v.parentNode.insertBefore(o, v.nextSibling), i.M._.node.get("form", e)
                        }, templates: {_root: '<div class="blok-title" data-route="<%= name %>/toggle"><\/div>' + '<div class="blok-body"><div class="blok-content"><h4>selection options<\/h4><select name="blok-option-type"><\/select><select name="blok-option-mode"><\/select>' + '<h4>scatch pad<\/h4><input type="button" value=">" data-target="_scratchpad" data-route="<%= name %>/collect"> Found: <span class="blok-matches">0<\/span>' + '<div class="blok-scratchpad <%= style %>" onClick="this.contentEditable=\'true\';"><\/div><\/div>' + '<div id="<%= id %>-content" class="blok-content"><\/div>' + '<div id="<%= id %>-options" class="blok-content"><span class="blok-icon <%= style %>" data-route="<%= name %>/option">&nbsp;&gt;&nbsp;<\/span><select name="<%= id %>-options" class="blok-input-width"><\/select><\/div>' + "<\/div>"}
                })
            }, HoneyMediator: function()
            {
                i.M._.object.clobber(this, new i.V.BlokMediator, {
                    configure: function(n)
                    {
                        this.view.cache("_title", ".blok-title"),
                        this.view.cache("_body", ".blok-body"),
                        this.view.cache("_content", "#" + this.view.id + "-content"),
                        this.view.cache("_options", this.view.id + "-options", "select"),
                        this.view.cache("_sort", "#" + this.view.id + "-sort"),
                        i.V._.html.options(this.view.nodes._options, n.options),
                        this.addHandler(this.name + "/expand", "view/stack")
                    }, handler: function(n, t, r)
                        {
                            var e = this.view.root,
                                f = n.split("/").pop(),
                                u;
                            switch (f)
                            {
                                case"expand":
                                    u = i.M._.node.get(".blok-hidden", r),
                                    i.V._.style.display.toggle(u)
                            }
                        }, setList: function(n, t)
                        {
                            var i = "_" + t;
                            return t && this.getTemplate(i) || (i = "_generic"), this.setContent(this.getTemplate(i), {
                                    name: this.name, entry: n, style: this.view.style
                                })
                        }, setSort: function(n)
                        {
                            var t = this.setNodeHtml("_sort", this.getTemplate("_sort"), {
                                    name: this.name, style: this.view.style, fields: n
                                });
                            return t.style.display = "block", this.view.cache("_sorttag", ".blok-content-tag", !1, t), t
                        }, setSortTag: function(n)
                        {
                            var t = this.setNodeText("_sorttag", n)
                        }, templates: {
                            _root: '<div class="blok-title"><\/div><div class="blok-body">' + '<div id="<%= id %>-content" class="blok-content"><\/div>' + '<div id="<%= id %>-options" class="blok-content"><span class="blok-icon <%= style %>" data-route="<%= name %>/option">&nbsp;&gt;&nbsp;<\/span><select name="<%= id %>-options" class="blok-input-width"><\/select><\/div>' + '<div id="<%= id %>-sort" class="blok-content blok-hidden"><\/div>' + "<\/div>", _worksheets: "<% for (var i = 0; i < entry.length; i++){ %>" + '<div data-route="<%= name %>/key" data-key="<%= entry[i].id %>" title="<%= entry[i].title %>">' + '<span class="blok-title <%= style %> bubble"><%= entry[i].title %><\/span>' + "<\/div><% } %>", _generic: "<% for (var i = 0; i < entry.length; i++){ %>" + '<div data-route="<%= name %>/expand">' + "<% var f=false; var j=0; for (var p in entry[i]){ %>" + '<% if(p=="timestamp"||p=="_timestamp") continue;%>' + "<% if(!f){%>" + '<span class="blok-title <%= style %> bubble" title="<%= p %>"><%= entry[i][p] %><\/span>' + '<span class="blok-hidden blok-content-tags" >' + "<% f=true;} else { %>" + "<% var v = entry[i][p]; %>" + "<% if(v.indexOf('http')==0) v='<a href=\"'+v+'\" target=\"_blank\">'+v+'<\/a>'; %>" + "<h4><%= p %><\/h4>" + '<span title="<%= p %>"><%= v %><\/span>' + "<% } j++; } %>" + "<\/span><\/div><% } %>", _sort: '<h4>sort<\/h4><span class="blok-inline-links">' + "<% for (var i = 0; i < fields.length; i++){ var label=fields[i]; %>" + '<span data-route="<%= name %>/sort" data-key="<%= fields[i] %>"><%= (label.length>25?label.substr(0,22)+"...":label) %><\/span> ' + "<% } %><\/span>"
                        }
                })
            }, ToolsMediator: function()
            {
                i.M._.object.clobber(this, new i.V.BlokMediator, {
                    configure: function(n)
                    {
                        var t = "#" + this.view.id;
                        this.view.cache("_title", ".blok-title"),
                        this.view.cache("_body", ".blok-body"),
                        this.view.cache("_content", t + "-content"),
                        this.view.cache("_bookmark", t + "-bookmark"),
                        this.view.cache("_options", this.view.id + "-options", "select"),
                        this.view.cache("_keys", t + "-keys"),
                        this.view.cache("_nokeys", t + "-nokeys"),
                        this.view.cache("_key", t + "-key"),
                        i.V._.html.options(this.view.nodes._options, n.options),
                        this.setNodeHtml("_title", this.getTemplate("_title"), {
                            name: this.name, title: "Tools", subtitle: "Add and remove bloks", action: "toggle", style: this.view.style
                        })
                    }, setBookmark: function(n, t)
                        {
                            this.setNodeHtml("_bookmark", this.getTemplate("_bookmark"), {
                                name: this.name, src: n, count: t, style: this.view.style
                            })
                        }, getKeys: function(n)
                        {
                            for (var r = [], u = i.M._.node.get("div", this.view.nodes._keys, !0), f, t = 0; t < u.length; t++)
                                n && i.M._.node.hasClass(u[t], "blok-disabled") || (f = u[t].getAttribute("data-key"), i.M._.object.isSet(f) && r.push(f));
                            return r.length > 0 && (this.view.nodes._nokeys.style.display = "none"), r
                        }, addKey: function(n, t)
                        {
                            return this.view.nodes._keys.insertAdjacentHTML("beforeEnd", i.V._.html.template(this.getTemplate("_key"), {
                                    name: this.name, id: t, key: n, style: this.view.style
                                })), i.M._.node.get("#" + t + "-key")
                        }, toggleKey: function(n)
                        {
                            var t = i.M._.node.get("#" + n + "-key", this.view.nodes._keys);
                            t && (i.M._.node.hasClass(t, "blok-disabled") ? i.M._.node.removeClass(t, "blok-disabled") : i.M._.node.addClass(t, "blok-disabled"))
                        }, templates: {
                            _root: '<div class="blok-title"><\/div><div class="blok-body">' + '<div id="<%= id %>-content" class="blok-content">' + '<h4>keys<\/h4><div id="<%= id %>-nokeys"><p>No keys found - to get started, copy and paste a <em>published<\/em> Google Drive spreadsheet key or form key into the text input below. Note: data capture using forms requires Google Chrome or Firefox (<em>Use the drop down options for further information about using bee<\/em>).<\/p><\/div><div id="<%= id %>-keys"><\/div>' + '<h4>add key<\/h4><div><span class="blok-icon <%= style %>" data-key="<%= id %>-key" data-route="<%= name %>/add" title="Add">&nbsp;+&nbsp;<\/span><input id="<%= id %>-key" type="text" class="blok-input-width" value=""><\/div>' + '<h4>bookmark<\/h4><div id="<%= id %>-bookmark"><\/div>' + '<div id="<%= id %>-options"><h4>options<\/h4><span class="blok-icon <%= style %>" data-route="<%= name %>/option">&nbsp;&gt;&nbsp;<\/span><select name="<%= id %>-options" class="blok-input-width"><\/select><\/div>' + "<\/div><\/div>", _bookmark: '<p><% if(count>0){ %><a title="Drag to bookmarks bar!" onclick="return false;" href="javascript:(function(d,t){var g = d.createElement(t),s = d.getElementsByTagName(t)[0];g.src=\'<%= src %>\';s.parentNode.insertBefore(g, s);}(document,\'script\'));">Palmoto Bee<\/a><% } else {%>Palmoto Bee<% } %> (<%= count %> key/s)<\/p>', _key: '<div class="blok-key <%= style %>" title="Toggle" id="<%= id %>-key" data-id="<%= id %>" data-key="<%= key %>" data-route="<%= name %>/key">&nbsp;<%= key %>&nbsp;<\/div>'
                        }
                })
            }
    },
    i.C = {
        _: {
            startTime: new Date, timers: {}, alert: function(n)
                {
                    var t = i.M._.node.get("#blok-alert");
                    return t || (document.body.insertAdjacentHTML("afterbegin", '<div id="blok-alert"><\/div>'), t = i.M._.node.get("#blok-alert")), t.style.display = "block", alert(n), t.style.display = "none", !0
                }, log: function(n, t)
                {
                    var r,
                        u;
                    t = t || "JS@ ",
                    r = t + n + " (" + (new Date - this.startTime) + ")",
                    typeof console != "undefined" ? console.log(r) : (u = i.M._.node.get("#blok-log"), u && i.V._.text.set(u, r, "append"))
                }, init: function()
                {
                    for (var n, i, t = 0; t < arguments.length; t++)
                    {
                        n = arguments[t];
                        for (i in n)
                            n.hasOwnProperty(i) && i.indexOf("_INIT") != -1 && n[i]()
                    }
                }
        }, Facade_INIT: function()
            {
                i.M._.object.clobber(i.C.Facade.prototype, {
                    startUp: function(n, t)
                    {
                        if (this.name = i.M._.string.random(t + "-"), document.body)
                            this.registerObject("controller/startup", n, {name: t});
                        else
                        {
                            var r = this;
                            i.M._.event.add(document, "DOMContentLoaded", function()
                            {
                                r.registerObject("controller/startup", n, {name: t})
                            })
                        }
                    }, registerObject: function(n, t, r)
                        {
                            if (i.M._.object.isFunction(t.onRegister))
                            {
                                var u = this;
                                t.name = n,
                                t._facade = u,
                                t.listen = function()
                                {
                                    return [].unshift.call(arguments, this._facade), this._facade._listen.apply(this, arguments)
                                },
                                t.notify = function()
                                {
                                    return [].unshift.call(arguments, this._facade), this._facade._notify.apply(this, arguments)
                                },
                                t.handle = function()
                                {
                                    return this._facade._handle.apply(this, arguments)
                                };
                                t.onRegister(r);
                                t.notify("registered")
                            }
                            return this.objectMap = i.M._.object.setByPath(this.objectMap, n, t), this.retrieveObject(n)
                        }, setObject: function(n, t)
                        {
                            i.M._.object.isUndefined(this.retrieveObject(n)) || i.M._.object.setByPath(this.objectMap, n, t)
                        }, retrieveObject: function(n, t)
                        {
                            var r = i.M._.object.getByPath(this.objectMap, n);
                            return !r && t ? this.registerObject(n, new t) : r
                        }, deleteObject: function(){}, _notify: function(n, t)
                        {
                            var u = this.name + "/" + t,
                                r,
                                f;
                            if (i.M._.object.isSet(n._observers) && i.M._.object.isSet(n._observers[u]))
                                for (r = null, f = 0; f < n._observers[u].length; f++)
                                    r = n.retrieveObject(n._observers[u][f]),
                                    i.M._.object.isSet(r) && r.handle.apply(r, [this.name].concat(Array.prototype.slice.call(arguments))),
                                    r = null;
                            else
                                this.handle != null ? this.handle.apply(this, [this.name].concat(Array.prototype.slice.call(arguments))) : i.C._.log("No handler registered @" + u)
                        }, _handle: function(n, t, r)
                        {
                            var u = n + "/" + r,
                                f = this._handlers || (this._handlers = {});
                            i.M._.object.isSet(f[u]) && f[u].apply(this, Array.prototype.slice.call(arguments, 2))
                        }, _listen: function(n, t, r, u)
                        {
                            var f,
                                e,
                                s,
                                o,
                                h;
                            if (i.M._.object.isSet(u))
                                if (f = u + "/" + t, e = n._observers || (n._observers = {}), i.M._.object.isSet(e[f]))
                                {
                                    for (s = !0, o = 0; o < e[f].length; o++)
                                        e[f][o] == this.name && (s = !1);
                                    s && e[f].push(this.name)
                                }
                                else
                                    e[f] = [this.name];
                            else
                                f = this.name + "/" + f;
                            h = this._handlers || (this._handlers = {}),
                            h[f] = r
                        }
                })
            }, Facade: function()
            {
                i.M._.object.clobber(this, {
                    objectMap: {
                        controller: {}, model: {}, view: {}
                    }, name: null
                })
            }, Controller_INIT: function()
            {
                i.M._.object.clobber(i.C.Controller.prototype, {
                    onRegister: function(n)
                    {
                        n && n.model && this.addModel(n.model),
                        this.configure(n ? n.config : null)
                    }, _configure: function(){}, _handler: function(){}, addModel: function(n)
                        {
                            this.model = n,
                            this.listen("busy", this.busy, this.model.name),
                            this.listen("change", this.change, this.model.name),
                            this.listen("error", this.error, this.model.name)
                        }
                })
            }, Controller: function()
            {
                i.M._.object.clobber(this, {
                    id: null, mediator: null, state: 0, configure: function(n)
                        {
                            this._configure(n)
                        }, handler: function(n, t, i)
                        {
                            this._handler(n, t, i)
                        }, busy: function()
                        {
                            this.mediator.busy(),
                            this.state = 2
                        }, error: function()
                        {
                            this.mediator.error(),
                            this.state = 3
                        }, ready: function()
                        {
                            this.mediator.ready(),
                            this.state = 1
                        }, change: function(){}, _load: function()
                        {
                            this.state != 2 && this.model && this.model.fetch()
                        }, _reload: function()
                        {
                            this.state != 2 && this.model && this.model.refresh()
                        }
                })
            }, ShellController: function()
            {
                i.M._.object.clobber(this, new i.C.Controller, {configure: function(n)
                    {
                        var h = n.facade.registerObject("model/params", new i.M.Object),
                            s = i.M._.document.script.source(n.name + ".js"),
                            t = i.M._.url.params.get(s),
                            u,
                            e,
                            r,
                            o,
                            f;
                        if (t && t.embed && (t = i.M._.object.clobber(i.M._.url.params.get(window.location.href), t)), i.M._.object.isUndefined(t.tools) && (t.tools = !0), t.src = s.split("?")[0], h.set(null, t), u = "palmoto-blok-shell", e = i.M._.node.get("#" + u), !e && (this.mediator = new i.V.ShellMediator, this.mediator.configure({
                                id: u, params: t
                            }), e = i.M._.node.get("#" + u), r = this.mediator.view.nodes._statics, r && r.hasChildNodes()))
                            for (f = 0; f < r.children.length; f++)
                                o = i.M._.node.get(".blok-title", r.children[f]),
                                o && i.M._.event.add(o, "click", function(n)
                                {
                                    var t = i.M._.event.delegate(n).parentNode,
                                        r = i.V._.style.display.toggle(i.M._.node.get(".blok-body", t));
                                    i.M._.node.get(".blok-toggle", t).innerHTML = r ? "&#9650;" : "&#9660;"
                                });
                        n.facade.registerObject("controller/stack", new i.C.StackController, {config: {
                                id: "stack-" + i.M._.string.random(), stack: this.mediator.view.nodes._stack
                            }})
                    }})
            }, StackController: function()
            {
                i.M._.object.clobber(this, new i.C.Controller, {
                    configure: function(n)
                    {
                        this.id = n.id,
                        n.stack.insertAdjacentHTML("afterBegin", '<div id="' + this.id + '" class="blok-stack"><\/div>');
                        var t = this._facade.registerObject("model/" + i.M._.string.random("_"), new i.M.Object);
                        t.set("bloks", {}),
                        t.set("index", 0),
                        t.set("pointer", ""),
                        t.set("key", ""),
                        this.addModel(t),
                        this.mediator = this._facade.registerObject("view/" + this.name.split("/").pop(), new i.V.StackMediator, {view: {id: this.id}}),
                        this.listen("registered", this.handler, "controller/startup")
                    }, handler: function(n)
                        {
                            var e = n.split("/").pop(),
                                r,
                                u,
                                f,
                                t;
                            switch (e)
                            {
                                case"registered":
                                    if (r = this._facade.retrieveObject("model/params"), u = r.get("key"), u)
                                        for (f = u.split(","), t = 0; t < f.length; t++)
                                            this.addFeedBlok(f[t]);
                                    r.get("tools") && this.addBlok(i.C.ToolsController, "static-tools", " ", "beforeEnd")
                            }
                        }, exists: function(n)
                        {
                            var t = this.model.get("bloks"),
                                i;
                            for (i in t)
                                if (t[i].key == n)
                                    return !0;
                            return !1
                        }, addBlok: function(n, t, i, r, u)
                        {
                            if (this.exists(t))
                                return !1;
                            var e = this.model.get("index"),
                                f = this.id + "-blok-" + e;
                            return this.model.set("bloks/" + f, {
                                    id: f, key: t, position: r, target: u, state: 1
                                }), this.model.set("index", e + 1), this.model.set("pointer", f, !1), this._facade.registerObject("controller/" + f, new n, {config: {
                                            stack: this.mediator.name, id: f, key: t, title: i
                                        }}), !0
                        }, addFeedBlok: function(n, t, r, u)
                        {
                            var f = i.M._.google.feed.extractKey(n);
                            return f ? this.addBlok(i.M._.google.feed.type(f) == 2 ? i.C.HoneyController : i.C.BeeController, f, t, r, u) : (i.C._.alert("Invalid data key."), !1)
                        }, disable: function(n)
                        {
                            this._setState(n, 0)
                        }, change: function()
                        {
                            var t = this.model.get("pointer"),
                                n = this.model.get("bloks/" + t);
                            n.state == 1 ? this.mediator.showBlok(n.id, n.target, n.position) : this.mediator.hideBlok(n.id)
                        }, activate: function(n)
                        {
                            this._setState(n, 1)
                        }, _setState: function(n, t)
                        {
                            var i = this.model.get("bloks/" + n);
                            i && (i.state = t, this.model.set("pointer", n, !1))
                        }
                })
            }, BlokController_INIT: function()
            {
                i.M._.object.clobber(i.C.BlokController.prototype, {
                    _configure: function(n)
                    {
                        (this.listen(this.mediator.name + "/option", this.handler, n.stack), this.listen(this.mediator.name + "/toggle", this.handler, n.stack), this.listen(this.mediator.name + "/load", this.handler, n.stack), this.model) && (this.model.cache && this.model.fetchCache(), this.change())
                    }, _handler: function(n)
                        {
                            var r = n.split("/").pop(),
                                u,
                                f,
                                t;
                            r == "option" && (r = this.mediator.getNodeText("_options").split("/").pop());
                            switch (r)
                            {
                                case"toggle":
                                    this.mediator.toggleBody();
                                    break;
                                case"load":
                                    this.mediator.toggleBody() && this._load();
                                    break;
                                case"reload":
                                    this._reload();
                                    break;
                                case"remove":
                                    u = this._facade.retrieveObject("controller/stack"),
                                    u.disable(this.mediator.view.id);
                                    break;
                                case"breakout":
                                case"facebook":
                                case"twitter":
                                case"google":
                                case"addthis":
                                case"email":
                                    t = this._facade.retrieveObject("controller/navigateCommand", i.C.NavigateCommand),
                                    t.key(this.model.get("key"), this.model.get("title"), r);
                                    break;
                                case"drive":
                                    f = this.model.getViewUrl(),
                                    t = this._facade.retrieveObject("controller/navigateCommand", i.C.NavigateCommand),
                                    t.open(f)
                            }
                        }
                })
            }, BlokController: function()
            {
                i.M._.object.clobber(this, new i.C.Controller, {configure: function(n)
                    {
                        this.id = n.id,
                        this.mediator = this._facade.registerObject("view/" + this.id, new i.V.BlokMediator, {
                            view: {
                                id: this.id, style: "scheme-charcoal"
                            }, config: n
                        }),
                        this._configure(n)
                    }})
            }, BeeController: function()
            {
                i.M._.object.clobber(this, new i.C.BlokController, {
                    configure: function(n)
                    {
                        this.id = n.id;
                        var r = n.key,
                            u = n.title ? n.title : "Bee Blok",
                            t = new i.M.Form;
                        t = this._facade.registerObject("model/" + i.M._.string.random("_"), t, {endpoint: t.getDataUrl(r)}),
                        t.set(null, {
                            key: r, title: u
                        }),
                        this.addModel(t),
                        this.mediator = this._facade.registerObject("view/" + this.id, new i.V.BeeMediator, {
                            view: {
                                id: this.id, style: "scheme-lime"
                            }, config: {
                                    types: i.M.__.options.nectar.types, modes: i.M.__.options.nectar.modes, options: {
                                            blok: i.M.__.options.blok, share: i.M.__.options.share
                                        }
                                }
                        }),
                        this.listen(this.mediator.name + "/collect", this.handler, n.stack),
                        this._configure(n)
                    }, handler: function(n, t, r)
                        {
                            var l = n.split("/").pop(),
                                f,
                                h,
                                u,
                                o;
                            switch (l)
                            {
                                case"collect":
                                    var s = 0,
                                        e = r.getAttribute("data-type"),
                                        c = this.mediator.getNodeText("_mode");
                                    c != "override" && i.M._.object.isSet(e) || (e = this.mediator.getNodeText("_type")),
                                    f = i.M._.object.getByPath(i.M.__.options.nectar.types, e),
                                    o = "",
                                    f && (h = null, e.indexOf("custom/") == 0 && (h = this.mediator.getNodeText("_custom")), u = typeof f.$v == "function" ? f.$v(h) : f.$v, o = " " + f.$t, u != null && u != "" && (i.M._.object.isArray(u) ? (s = u.length, u = u.join(",")) : s = 1, this.mediator.setNodeText(r.getAttribute("data-target"), u, c))),
                                    this.mediator.setNodeText("_matches", s + o);
                                    break;
                                default:
                                    this._handler(n, t, r)
                            }
                        }, change: function()
                        {
                            var n = this.model.get(),
                                r,
                                t,
                                u;
                            if (!n)
                            {
                                this.mediator.setContent("Request failed - please check the form is live and accepting responses.");
                                return
                            }
                            if (r = this.model.get("form"), this.mediator.setTitle(this.model.get("title"), this.model.get("key"), r ? "toggle" : "load"), !r)
                            {
                                this.mediator.setContent("");
                                return
                            }
                            t = this.mediator.setForm(r),
                            u = t.action,
                            t.onsubmit = function()
                            {
                                return !1
                            },
                            n = this.model,
                            i.M._.event.add(t, "submit", function()
                            {
                                var r = i.M._.url.params.form(t);
                                return i.M._.xhr.post(u.replace("&ifq", ""), r, function(t)
                                    {
                                        var r = t.match(/<div class="ss-custom-resp">([\s\S]*?)<\/div>/);
                                        if (r && r.length == 2)
                                        {
                                            i.C._.alert(r[1]);
                                            return
                                        }
                                        n.set(null, n.parse(t), !1) || i.C._.alert("Failed...")
                                    }), !1
                            }),
                            this.ready()
                        }
                })
            }, HoneyController: function()
            {
                i.M._.object.clobber(this, new i.C.BlokController, {
                    configure: function(n)
                    {
                        this.id = n.id;
                        var r = n.key,
                            u = n.title ? n.title : "Honey Blok",
                            t = new i.M.Feed;
                        t = this._facade.registerObject("model/" + i.M._.string.random("_"), t, {endpoint: t.getDataUrl(r)}),
                        t.set(null, {
                            key: r, title: u
                        }),
                        this.addModel(t),
                        this.mediator = this._facade.registerObject("view/" + this.id, new i.V.HoneyMediator, {
                            view: {
                                id: this.id, style: "scheme-aqua"
                            }, config: {options: {
                                        blok: i.M.__.options.blok, data: i.M.__.options.data, share: i.M.__.options.share
                                    }}
                        }),
                        this.listen(this.mediator.name + "/key", this.handler, n.stack),
                        this.listen(this.mediator.name + "/sort", this.handler, n.stack),
                        this._configure(n)
                    }, handler: function(n, t, i)
                        {
                            var f = n.split("/").pop(),
                                r,
                                u,
                                e,
                                o,
                                s;
                            f == "option" && (f = this.mediator.getNodeText("_options").split("/").pop());
                            switch (f)
                            {
                                case"key":
                                    this._facade.retrieveObject("controller/stack").addFeedBlok(i.getAttribute("data-key"));
                                    break;
                                case"sort":
                                    if (r = i.getAttribute("data-key"), r)
                                        s = this.model.sort("entry/" + (r == "timestamp" ? "_" + r : r)),
                                        this.mediator.setSortTag("sort " + (s > 0 ? "descending" : "ascending"));
                                    else
                                    {
                                        if (u = this.model.get("entry"), !u || u.length == 0)
                                            return;
                                        e = [];
                                        for (o in u[0])
                                            o != "_timestamp" && e.push(o);
                                        this.mediator.setSort(e)
                                    }
                                    break;
                                default:
                                    this._handler(n, t, i)
                            }
                        }, change: function()
                        {
                            var n = this.model.get("entry"),
                                i,
                                r,
                                t;
                            if (this.mediator.setTitle(this.model.get("title"), this.model.get("key"), n ? "toggle" : "load"), !n)
                            {
                                this.mediator.setContent("No data.");
                                return
                            }
                            if (i = this.model.get("type"), i == "worksheets")
                                for (r = this._facade.retrieveObject("controller/stack"), t = 0; t < n.length; t++)
                                    r.addFeedBlok(n[t].id, n[t].title, "beforeBegin", this.mediator.view.root);
                            this.mediator.setList(n, i),
                            i == "worksheets" && r.disable(this.mediator.view.id),
                            this.ready()
                        }
                })
            }, ToolsController: function()
            {
                i.M._.object.clobber(this, new i.C.BlokController, {
                    configure: function(n)
                    {
                        this.id = n.id,
                        this.mediator = this._facade.registerObject("view/" + this.id, new i.V.ToolsMediator, {
                            view: {
                                id: this.id, style: "scheme-charcoal"
                            }, config: {options: {
                                        support: i.M.__.options.support, bloks: i.M.__.options.bloks, share: i.M.__.options.share
                                    }}
                        }),
                        this.addModel(this._facade.retrieveObject("controller/stack").model),
                        this.listen(this.mediator.name + "/add", this.handler, n.stack),
                        this.listen(this.mediator.name + "/key", this.handler, n.stack),
                        this._configure(n)
                    }, change: function()
                        {
                            var r = this.model.get("bloks"),
                                t = this.mediator.getKeys(),
                                e = this.model.get("pointer"),
                                n,
                                i,
                                u,
                                f;
                            for (i in r)
                                n = r[i],
                                t.indexOf(n.key) != -1 ? i == e && this.mediator.toggleKey(n.id) : n.state == 1 && n.key.indexOf("static") != 0 && this.mediator.addKey(n.key, n.id);
                            t = this.mediator.getKeys(!0),
                            this.model.set("key", this.serialiseKeys(t)),
                            t.length == 0 && this.mediator.toggleBody(!0),
                            u = this._facade.retrieveObject("model/params"),
                            f = u.get("src").replace(/^https?:/, "") + "?key=" + this.model.get("key"),
                            this.mediator.setBookmark(f, t.length),
                            this.ready()
                        }, serialiseKeys: function(n)
                        {
                            var t = n || this.mediator.getKeys(!0);
                            return !t || t.length == 0 ? "" : encodeURIComponent(this.mediator.getKeys(!0).join(","))
                        }, handler: function(n, t, r)
                        {
                            var u = n.split("/").pop(),
                                f,
                                e,
                                o,
                                s,
                                h,
                                c;
                            u == "option" && (u = this.mediator.getNodeText("_options").split("/").pop());
                            switch (u)
                            {
                                case"key":
                                    f = r.getAttribute("data-id"),
                                    e = this._facade.retrieveObject("controller/stack"),
                                    i.M._.node.hasClass(r, "blok-disabled") ? e.activate(f) : e.disable(f);
                                    break;
                                case"add":
                                    o = i.M._.string.trim(this.mediator.getNodeText("_key")),
                                    s = this._facade.retrieveObject("controller/stack").addFeedBlok(o),
                                    s && this.mediator.setNodeText("_key", "");
                                    break;
                                case"feedback":
                                case"registration":
                                case"documentation":
                                    h = r.getAttribute("data-hash") || u,
                                    c = this._facade.retrieveObject("controller/navigateCommand", i.C.NavigateCommand),
                                    c.palmoto("bee/" + h);
                                    break;
                                default:
                                    this._handler(n, t, r)
                            }
                        }
                })
            }, NavigateCommand: function()
            {
                i.M._.object.clobber(this, {
                    _title: "Palmoto Bee", onRegister: function(){}, share: function(n, t, r)
                        {
                            var f = "",
                                u = {},
                                e = t || this._title;
                            switch (r)
                            {
                                case"facebook":
                                    f = "http://www.facebook.com/sharer.php",
                                    u.u = n,
                                    u.t = e;
                                    break;
                                case"twitter":
                                    f = "http://twitter.com/home",
                                    u.status = e + " " + n;
                                    break;
                                case"google":
                                    f = "http://plus.google.com/share",
                                    u.url = n;
                                    break;
                                case"addthis":
                                    f = "https://api.addthis.com/oexchange/0.8/offer",
                                    u.url = n,
                                    u.title = e;
                                    break;
                                case"email":
                                    f = "http://api.addthis.com/oexchange/0.8/forward/email/offer",
                                    u.url = n,
                                    u.title = e
                            }
                            this.open(f + "?" + i.M._.url.params.object(u))
                        }, open: function(n, t)
                        {
                            var i = t || "_blank";
                            window.open(n, i)
                        }, key: function(n, t, i)
                        {
                            var r = "http://bee.palmoto.com/" + (n ? "#key=" + n : ""),
                                u;
                            i == "breakout" ? this.open(r) : (u = t || this._title, this.share(r, t, i))
                        }, palmoto: function(n)
                        {
                            var t = "http://www.palmoto.com/" + n;
                            this.open(t)
                        }
                })
            }
    };
    /*!
    * @preserve Qwery - A Blazing Fast query selector engine
    * https://github.com/ded/qwery
    * Copyright (c) 2012 Dustin Diaz
    * MIT License http://opensource.org/licenses/mit-license.php
    */
    i.Qwery = function()
    {
        function u()
        {
            this.c = {}
        }
        function nt(n)
        {
            return yt.g(n) || yt.s(n, "(^|\\s+)" + n + "(\\s+|$)", 1)
        }
        function a(n, t)
        {
            for (var i = 0, r = n.length; i < r; i++)
                t(n[i])
        }
        function tt(n)
        {
            for (var t = [], i = 0, r = n.length; i < r; ++i)
                h(n[i]) ? t = t.concat(n[i]) : t[t.length] = n[i];
            return t
        }
        function o(n)
        {
            for (var t = 0, r = n.length, i = []; t < r; t++)
                i[t] = n[t];
            return i
        }
        function it(t)
        {
            while (t = t.previousSibling)
                if (t[n] == 1)
                    break;
            return t
        }
        function v(n)
        {
            return n.match(ei)
        }
        function y(t, r, u, f, e, o, s, h, c, l, a)
        {
            var p,
                b,
                v,
                y,
                w;
            if (this[n] !== 1 || r && r !== "*" && this[k] && this[k].toLowerCase() !== r || u && (b = u.match(ni)) && b[1] !== this.id)
                return !1;
            if (u && (w = u.match(ti)))
                for (p = w.length; p--; )
                    if (!nt(w[p].slice(1)).test(this.className))
                        return !1;
            if (c && i.pseudos[c] && !i.pseudos[c](this, a))
                return !1;
            if (f && !s)
            {
                y = this.attributes;
                for (v in y)
                    if (Object.prototype.hasOwnProperty.call(y, v) && (y[v].name || v) == e)
                        return this
            }
            return f && !bt(o, si(this, e) || "", s) ? !1 : this
        }
        function f(n)
        {
            return pt.g(n) || pt.s(n, n.replace(ui, "\\$1"))
        }
        function bt(n, i, r)
        {
            switch (n)
            {
                case"=":
                    return i == r;
                case"^=":
                    return i.match(t.g("^=" + r) || t.s("^=" + r, "^" + f(r), 1));
                case"$=":
                    return i.match(t.g("$=" + r) || t.s("$=" + r, f(r) + "$", 1));
                case"*=":
                    return i.match(t.g(r) || t.s(r, f(r), 1));
                case"~=":
                    return i.match(t.g("~=" + r) || t.s("~=" + r, "(?:^|\\s+)" + f(r) + "(?:\\s+|$)", 1));
                case"|=":
                    return i.match(t.g("|=" + r) || t.s("|=" + r, "^" + f(r) + "(-|$)", 1))
            }
            return 0
        }
        function kt(t, i)
        {
            var f = [],
                h = [],
                o,
                p,
                b,
                d,
                c,
                e,
                g,
                r = i,
                u = l.g(t) || l.s(t, t.split(vt)),
                s = t.match(at);
            if (!u.length || (d = (u = u.slice(0)).pop(), u.length && (b = u[u.length - 1].match(st)) && (r = ut(i, b[1])), !r))
                return f;
            for (e = v(d), c = r !== i && r[n] !== 9 && s && /^[+~]$/.test(s[s.length - 1]) ? function(t)
            {
                while (r = r.nextSibling)
                    r[n] == 1 && (e[1] ? e[1] == r[k].toLowerCase() : 1) && (t[t.length] = r);
                return t
            }([]) : r[w](e[1] || "*"), o = 0, p = c.length; o < p; o++)
                (g = y.apply(c[o], e)) && (f[f.length] = g);
            return u.length ? (a(f, function(n)
                {
                    rt(n, u, s) && (h[h.length] = n)
                }), h) : f
        }
        function dt(n, t, i)
        {
            if (s(t))
                return n == t;
            if (h(t))
                return !!~tt(t).indexOf(n);
            for (var f = t.split(","), r, u; t = f.pop(); )
                if (r = l.g(t) || l.s(t, t.split(vt)), u = t.match(at), r = r.slice(0), y.apply(n, v(r.pop())) && (!r.length || rt(n, r, u, i)))
                    return !0;
            return !1
        }
        function rt(n, t, i, r)
        {
            function f(n, r, e)
            {
                while (e = oi[i[r]](e, n))
                    if (s(e) && y.apply(e, v(t[r])))
                    {
                        if (!r)
                            return e;
                        if (u = f(e, r - 1, e))
                            return u
                    }
            }
            var u;
            return (u = f(n, t.length - 1, n)) && (!r || e(u, r))
        }
        function s(t, i)
        {
            return t && typeof t == "object" && (i = t[n]) && (i == 1 || i == 9)
        }
        function p(n)
        {
            var t = [],
                i,
                r;
            n:for (i = 0; i < n.length; ++i)
            {
                for (r = 0; r < t.length; ++r)
                    if (t[r] == n[i])
                        continue n;
                t[t.length] = n[i]
            }
            return t
        }
        function h(n)
        {
            return typeof n == "object" && isFinite(n.length)
        }
        function gt(t)
        {
            return t ? typeof t == "string" ? i(t)[0] : !t[n] && h(t) ? t[0] : t : r
        }
        function ut(t, i, r)
        {
            return t[n] === 9 ? t.getElementById(i) : t.ownerDocument && ((r = t.ownerDocument.getElementById(i)) && e(r, t) && r || !e(t, t.ownerDocument) && d('[id="' + i + '"]', t)[0])
        }
        function i(n, t)
        {
            var i,
                u,
                r = gt(t);
            if (!r || !n)
                return [];
            if (n === window || s(n))
                return !t || n !== window && s(r) && e(n, r) ? [n] : [];
            if (n && h(n))
                return tt(n);
            if (i = n.match(fi))
            {
                if (i[1])
                    return (u = ut(r, i[1])) ? [u] : [];
                if (i[2])
                    return o(r[w](i[2]));
                if (hi && i[3])
                    return o(r[et](i[3]))
            }
            return d(n, r)
        }
        function ft(t, i)
        {
            return function(r)
                {
                    var f,
                        u;
                    if (ht.test(r))
                    {
                        t[n] !== 9 && ((u = f = t.getAttribute("id")) || t.setAttribute("id", u = "__qwerymeupscotty"), r = '[id="' + u + '"]' + r, i(t.parentNode || t, r, !0), f || t.removeAttribute("id"));
                        return
                    }
                    r.length && i(t, r, !1)
                }
        }
        var r = document,
            c = r.documentElement,
            et = "getElementsByClassName",
            w = "getElementsByTagName",
            b = "querySelectorAll",
            ot = "useNativeQSA",
            k = "tagName",
            n = "nodeType",
            d,
            ni = /#([\w\-]+)/,
            ti = /\.[\w\-]+/g,
            st = /^#([\w\-]+)$/,
            ii = /^([\w]+)?\.([\w\-]+)$/,
            ht = /(^|,)\s*[>~+]/,
            ri = /^\s+|\s*([,\s\+\~>]|$)\s*/g,
            ct = /[\s\>\+\~]/,
            lt = /(?![\s\w\-\/\?\&\=\:\.\(\)\!,@#%<>\{\}\$\*\^'"]*\]|[\s\w\+\-]*\))/,
            ui = /([.*+?\^=!:${}()|\[\]\/\\])/g,
            fi = new RegExp(st.source + "|" + /^([\w\-]+)$/.source + "|" + /^\.([\w\-]+)$/.source),
            at = new RegExp("(" + ct.source + ")" + lt.source, "g"),
            vt = new RegExp(ct.source + lt.source),
            ei = new RegExp(/^(\*|[a-z0-9]+)?(?:([\.\#]+[\w\-\.#]+)?)/.source + "(" + /\[([\w\-]+)(?:([\|\^\$\*\~]?\=)['"]?([ \w\-\/\?\&\=\:\.\(\)\!,@#%<>\{\}\$\*\^]+)["']?)?\]/.source + ")?(" + /:([\w\-]+)(\(['"]?([^()]+)['"]?\))?/.source + ")?"),
            oi = {
                " ": function(n)
                {
                    return n && n !== c && n.parentNode
                }, ">": function(n, t)
                    {
                        return n && n.parentNode == t.parentNode && n.parentNode
                    }, "~": function(n)
                    {
                        return n && n.previousSibling
                    }, "+": function(n, t, i, r)
                    {
                        return n ? (i = it(n)) && (r = it(t)) && i == r && i : !1
                    }
            };
        u.prototype = {
            g: function(n)
            {
                return this.c[n] || undefined
            }, s: function(n, t, i)
                {
                    return t = i ? new RegExp(t) : t, this.c[n] = t
                }
        };
        var yt = new u,
            pt = new u,
            t = new u,
            l = new u,
            e = "compareDocumentPosition" in c ? function(n, t)
            {
                return (t.compareDocumentPosition(n) & 16) == 16
            } : "contains" in c ? function(t, i)
            {
                return i = i[n] === 9 || i == window ? c : i, i !== t && i.contains(t)
            } : function(n, t)
            {
                while (n = n.parentNode)
                    if (n === t)
                        return 1;
                return 0
            },
            si = function()
            {
                var n = r.createElement("p");
                return (n.innerHTML = '<a href="#x">x<\/a>') && n.firstChild.getAttribute("href") != "#x" ? function(n, t)
                    {
                        return t === "class" ? n.className : t === "href" || t === "src" ? n.getAttribute(t, 2) : n.getAttribute(t)
                    } : function(n, t)
                    {
                        return n.getAttribute(t)
                    }
            }(),
            hi = !!r[et],
            ci = r.querySelector && r[b],
            li = function(t, i)
            {
                var r = [],
                    f,
                    u;
                try
                {
                    return i[n] === 9 || !ht.test(t) ? o(i[b](t)) : (a(f = t.split(","), ft(i, function(n, t)
                        {
                            u = n[b](t),
                            u.length == 1 ? r[r.length] = u.item(0) : u.length && (r = r.concat(o(u)))
                        })), f.length > 1 && r.length > 1 ? p(r) : r)
                }
                catch(e) {}
                return g(t, i)
            },
            g = function(t, i)
            {
                var u = [],
                    o,
                    h,
                    r,
                    s,
                    f,
                    c;
                if (t = t.replace(ri, "$1"), h = t.match(ii))
                {
                    for (f = nt(h[2]), o = i[w](h[1] || "*"), r = 0, s = o.length; r < s; r++)
                        f.test(o[r].className) && (u[u.length] = o[r]);
                    return u
                }
                return a(c = t.split(","), ft(i, function(t, o, h)
                    {
                        for (f = kt(o, t), r = 0, s = f.length; r < s; r++)
                            (t[n] === 9 || h || e(f[r], i)) && (u[u.length] = f[r])
                    })), c.length > 1 && u.length > 1 ? p(u) : u
            },
            wt = function(n)
            {
                typeof n[ot] != "undefined" && (d = n[ot] ? ci ? li : g : g)
            };
        return wt({useNativeQSA: !0}), i.configure = wt, i.uniq = p, i.is = dt, i.pseudos = {}, i
    }(),
    i.C._.init(i.M, i.V, i.C)
})(this, "palmoto")
